
import java.util.Arrays;
import java.util.Scanner;

class CHAMADA1 {

    static Scanner entrada = new Scanner(System.in);
    
    public static void main(String[] args) {
        
        String[] vet;
        
        int N = entrada.nextInt();
        int K = entrada.nextInt();
        
        vet = new String[N];
        
        for (int i = 0; i < vet.length; i++) {
            vet[i] = entrada.next();
        }
        Arrays.sort(vet);
        
        System.out.println(vet[K-1]);
    }

}
